package com.ygqh.baby.service;
import java.util.Date;
import java.util.List;

import  com.ygqh.baby.ao.QueryInfo;
import  com.ygqh.baby.ao.ResultSet;
import com.ygqh.baby.model.YgIndexModel;
import com.ygqh.baby.model.YgNotSaleHeadModel;
import com.ygqh.baby.model.YgSimilarityPublishModel;
import  com.ygqh.baby.po.YgPublish;
import com.ygqh.baby.po.YgPublishDetail;

public interface YgPublishService {

    
    List<YgPublish> find();
	int findCount();
	YgPublish findById(Long id);
	int deleteSoft(Long[] ids);
	int deleteSoft(Long id);
	int save(YgPublish ygPublish, List<YgPublishDetail> publishDetailList );
	int update(YgPublish ygPublish);
	/**
	 * 晒单列表查询
	 * @param queryInfo
	 * @param q
	 * @param sortField 排序字段
	 * @param sort asc desc
	 * @param userName 
	 * @return
	 */
	ResultSet<YgPublish> search(QueryInfo queryInfo, String q,String sortField,String sort,String checkStatus, Date startTime, Date endTime,Long id, String userName);
	YgIndexModel findDetailModel(Long id);
	
	/**
	 * 首页晒单
	 * @param queryInfo
	 * @return
	 */
	ResultSet<YgIndexModel> searchModel4Index(QueryInfo queryInfo);
	/**
	 * TA的晒单
	 * @param queryInfo
	 * @param userId
	 * @return
	 */
	ResultSet<YgIndexModel> searchModel4User(QueryInfo queryInfo,Long userId);
	
	/**
	 * 我的晒单
	 * @param queryInfo
	 * @param userId
	 * @return
	 */
	ResultSet<YgIndexModel> searchModel4Me(QueryInfo queryInfo,Long userId);
	
	/**
	 * Ta喜欢的晒单
	 * @param queryInfo
	 * @param userId
	 * @return
	 */
	ResultSet<YgIndexModel> searchModel4Praise(QueryInfo queryInfo,Long userId);
	
	/**
	 * 根据标签查晒单
	 * @param queryInfo
	 * @param userId
	 * @return
	 */
	ResultSet<YgIndexModel> selectModel4Tag(QueryInfo queryInfo,String tag);
	
	/**
	 * 非售商品头部
	 * @param pdtId 晒单图上的标签id
	 * @return
	 */
	YgNotSaleHeadModel findNotSaleHeadModel(Long pdtId);
	
	/**
	 *  首页-相似晒单
	 * @param productId
	 * @param groupId
	 * @return
	 */
	List<YgSimilarityPublishModel> findSimilarityPublishModel(Long productId,Long groupId,Long excludePublishId);
	
	/**
	 * 非售-相似晒单
	 * @param productId
	 * @param groupId
	 * @return
	 */
	List<YgSimilarityPublishModel> similarityPublish4NotSale(String brandName,String categoryId,Long excludePublishId);

	/**
	 * 批量审核晒单
	 * @param checkStatus  (Pass Reject)
	 * @param ids
	 * @return
	 */
	int updateBatchChechStatus(String checkBy,String checkStatus, Long[] ids);
	
	
	
	
	
	
	
	
	
	
	/**********************************以下是新接口*****************************************/
	
	/**
	 * 首页晒单
	 * @param queryInfo
	 * @return
	 */
	 ResultSet<YgIndexModel> newSearchModel4Index(QueryInfo queryInfo);

	 
 	/**
	 * TA的晒单
	 * @param queryInfo
	 * @param userId
	 * @return
	 */
	ResultSet<YgIndexModel> newSearchModel4User(QueryInfo queryInfo,Long userId);
	
	/**
	 * Ta喜欢的晒单
	 * @param queryInfo
	 * @param userId
	 * @return
	 */
	ResultSet<YgIndexModel> newSearchModel4Praise(QueryInfo queryInfo,Long userId);
	
	
	/**
	 * 根据标签查晒单
	 * @param queryInfo
	 * @return
	 */
	ResultSet<YgIndexModel> newSelectModel4Tag(QueryInfo queryInfo,String tag);
	
	
	/**
	 * 晒单评论添加
	 * @param publishId
	 * @param content
	 * @param userId
	 * @param receiverId
     * @return
	 */
	int publishComment(Long publishId, String content, Long userId, Long receiverId);


}
